home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Icon 8.1 / mep1 / External Functions / Samples / Code Resource Sources / UseResFile.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-11-24  |  729 b   |  33 lines  |  [TEXT/KAHL]

  1. /*
  2.  * ProIcon: Code resource to use a resource file.
  3.  *
  4.  * This code resource will appear under the resource type 'CODE', ID 1002,
  5.  * name "UseResFile".  Invoke with:
  6.  *
  7.  *      callout("CODE","UseResFile", refFile)
  8.  *
  9.  *      where:
  10.  *        resFile        is an integer file identifier for an open resource file
  11.  *
  12.  *      The function returns error 105 if there is an error using the file. 
  13.  */
  14.  
  15. #include "ProIcon.h"
  16.  
  17. pascal dptr main(dargv, argc, ip, callback)
  18. dptr dargv;
  19. short int argc;
  20. short int *ip;
  21. pointer (*callback)();
  22. {
  23.    if (argc != 1 || Type(Arg1) != T_Integer)
  24.       RunErr(Err101, &Arg1);            /* integer expected for first user arg */
  25.  
  26.    UseResFile((int)IntVal(Arg1));
  27.  
  28.    if (ResError())
  29.       RunErr(Err105, &Arg1);
  30.  
  31.    Return;
  32. }
  33.